ROOTFS_DIR = /home/chh/mount/kernel/linux-4.14.78/kmodules

ifeq ($(KERNELRELEASE), )

KERNEL_DIR = /home/chh/mount/kernel/linux-4.14.78
#KERNEL_DIR = /lib/modules/4.15.0-48-generic/build

CUR_DIR = $(shell pwd)
APP_NAME = read_test
APP_NAME2 = write_test
CROSS_COMPILE = /usr/local/arm/bin/arm-none-linux-gnueabi-
CC = $(CROSS_COMPILE)gcc

all:
	make -C $(KERNEL_DIR) M=$(CUR_DIR) modules
	$(CC) $(APP_NAME).c -o $(APP_NAME) -g
	$(CC) $(APP_NAME2).c -o $(APP_NAME2) -g
clean:
	make -C $(KERNEL_DIR) M=$(CUR_DIR) clean
install:
	cp -raf *.ko $(APP_NAME) $(APP_NAME2) $(ROOTFS_DIR)
else
#obj-m += misc_dev.o
obj-m += c0.o


endif
